<template>
	<view class="content">
		<u-navbar :placeholder='true' title="添加分行/子公司" leftIcon="arrow-leftward"
			@leftClick="leftClick('/pages/mine/setting/branch/index')">
		</u-navbar>
		<view class="main">
			<view>
				<view class="form">
					<view class="form-l">
						所屬分行/子公司
						<text style="color:#ED0000 ;">*</text>
					</view>
					<view class="form-r">
						<picker @change="bindPickerChange" :value="index" :range="array">
							<view class="picker">
								<view class="uni-input">{{array[index]}}</view>
								<u-icon size="28rpx" name="arrow-right"></u-icon>
							</view>
						</picker>
					</view>
				</view>
				<view class="form">
					<view class="form-l">
						部門編號
					</view>
					<view class="form-r">
						<input class="input-item" type="text">
					</view>
				</view>
				<view class="form">
					<view class="form-l">
						部門名稱（中）
						<text style="color:#ED0000 ;">*</text>
					</view>
					<view class="form-r">
						<input class="input-item" type="text">
					</view>
				</view>
				<view class="form">
					<view class="form-l">
						部門名稱（英）
						<text style="color:#ED0000 ;">*</text>
					</view>
					<view class="form-r">
						<input class="input-item" type="text" placeholder="">
					</view>
				</view>
				<view class="form">
					<view class="form-l">
						聯繫人
						<text style="color:#ED0000 ;">*</text>
					</view>
					<view class="form-r">
						<input class="input-item" type="text">
					</view>
				</view>
				<view class="form">
					<view class="form-l">
						電話
						<text style="color:#ED0000 ;">*</text>
					</view>
					<view class="form-r">
						<input class="input-item" type="text">
					</view>
				</view>
				<view class="form">
					<view class="form-l">
						分配金額
					</view>
					<view class="form-r">
						<input class="input-item" type="text">
					</view>
				</view>

			</view>
		</view>
		<view class="btn">
			提交
		</view>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				array: ['請選擇', '中国', '美国', '巴西', '日本'],
				index: 0,
				value: false
			}
		},
		methods: {
			change(e) {
				console.log('change', e);
			},
			bindPickerChange: function(e) {
				console.log('picker发送选择改变，携带值为', e.detail.value)
				this.index = e.detail.value
			},
			leftClick(url) {
				console.log('rightClick');
				uni.navigateTo({
					url: url
				})
			},
		}
	}
</script>

<style lang="scss">
	.content {
		background-color: #F5F6F9;
		width: 100%;
		height: 100vh;
		position: relative;

		.main {
			background-color: #fff;

			.form {
				margin: 0 32rpx;
				padding: 32rpx 0;
				display: flex;
				justify-content: space-between;
				align-items: center;
				border-bottom: 1rpx solid #DEDEDE;
				;

				.form-l {
					font-size: 32rpx;
					font-family: PingFang SC;
					font-weight: 500;
					color: #666666;
				}

				.form-r {

					// flex-direction: row-reverse;
					// margin-left: 48rpx;
					// flex: 1;
					// float: right;
					.picker {
						display: flex;
						align-items: center;
						justify-content: space-between;

						.uni-input {
							font-size: 32rpx;
							font-family: PingFang SC;
							font-weight: 500;
							color: #BEBEBE;
						}
					}

				}
			}

			.form:last-child {
				border-bottom: none;
			}
		}

		.open {
			font-size: 32rpx;
			font-family: PingFang SC;
			font-weight: 500;
			color: #666666;
			margin-top: 22rpx;
			background-color: #fff;
			padding: 32rpx;
			display: flex;
			align-items: center;
			justify-content: space-between;
		}

		.btn {
			position: absolute;
			bottom: 15rpx;
			left: 50%;
			transform: translateX(-50%);
			font-size: 32rpx;
			font-family: PingFang SC;
			font-weight: bold;
			line-height: 80rpx;
			color: #FFFFFF;
			width: 686rpx;
			height: 80rpx;
			text-align: center;
			background: #645AED;
			opacity: 1;
			border-radius: 30rpx;
		}
	}
</style>
